# Replication Package Overview

## Description

This repository contains replication materials for: “Measuring Politicians’ Public Personality Traits using Computational Text Analysis: A Multi-Method Feasibility Study for Agency and Communion.”

To conduct the replication, you can simply execute the `run.R` file which executes the scripts in the correct order and replicates the analysis and all Figures and Tables in the paper.

The replication materials can be found at: Birkenmaier, Lukas, 2025, "Replication Data for: Measuring Politicians' Public Personality Traits using Computational Text Analysis: A Multi-Method Feasibility Study for Agency and Communion", <https://doi.org/10.7910/DVN/MSY9L1>, Harvard Dataverse

## Data and Code Availability Statement

### Data

All datasets used in this analysis can be found in the `data` folder.

### Code

All code required to replicate the analysis results is available in the `code` folder. Please note that the training and prediction of XLM-RoBERTa, Llama 3, GPT-4o, and DeepSeek-V3 were run on Google Colab using A100 GPUs in Jupyter Notebooks. While we provide the complete scripts for replicating this analysis, the resulting predictions are directly loaded into this R workflow to ensure a consistent pipeline within R.

## Computational Requirements

The analysis was conducted in R using the following setup:

| Setting | Value |
|-----------------------|------------------------------------------------|
| version | R version 4.4.2 (2024-10-31) |
| os | macOS Sequoia 15.6.1 |
| system | aarch64, darwin20 |
| ui | RStudio |
| language | (EN) |
| collate | en_US.UTF-8 |
| ctype | en_US.UTF-8 |
| tz | Europe/Berlin |
| date | 2025-09-22 |
| rstudio | 2025.05.1+513 Mariposa Orchid (desktop) |
| pandoc | 3.4 \@ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown) |
| quarto | 1.6.39 \@ /usr/local/bin/quarto |

The runtime for each of the scripts can be found at the end of the run.log file

===== Runtime Summary (seconds) =====

code/helper_analysis.R : 0.005398989 seconds

code/classification_svm.R : 319.6033 seconds

code/prediction_svm.R : 0.97627 seconds

code/analysis_main_labeled.R : 0.835304 seconds

code/analysis_main_functional_tests.R : 1.613953 seconds

code/analysis_main_partisan_differences_GER.R : 4.577095 seconds

code/analysis_main_partisan_differences_USA.R : 0.6496201 seconds Total runtime: 328.2609 seconds

## Dependencies

The full library and dependencies are documented in the `renv.lock` file

## Contact

If you have questions or want to report any issues concerning the analysis, please refer to lukas.birkenmaier\@outlook.de.
